package com.cfx.exercise_40;

public class TestThread {

	public static void main(String[] args) {
		
		Thread t1 = new Thread("线程A"){
			public void run(){
				for (int i = 0; i < 100; i++) {
					if(i%2==0){
						System.out.println(Thread.currentThread().getName()+"--"+i);
					}
				}
			}
		};
		Thread t2 = new Thread("线程B"){
			public void run(){
				for (int i = 0; i < 100; i++) {
					if(i%2==1){
						System.out.println(Thread.currentThread().getName()+"--"+i);
					}
				}
			}
		};
		
		t1.start();
		t2.start();
		
	}
}
